home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3345 < prev    next >
Encoding:
Text File  |  1996-08-06  |  936 b   |  33 lines

  1. Path: locutus.rchland.ibm.com!usenet
  2. From: pstaite@vnet.ibm.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Getting the system time and date
  5. Date: 23 Jan 1996 14:14:08 GMT
  6. Organization: IBM OS/2 Device Driver Development  Rochester, MN
  7. Message-ID: <4e2qfg$pdr@locutus.rchland.ibm.com>
  8. References: <tate.1.002C7F92@netwest.com> <4duk43$8ql@barnacle.iol.ie>
  9. Reply-To: pstaite@vnet.ibm.com
  10. NNTP-Posting-Host: warpone.rchland.ibm.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4duk43$8ql@barnacle.iol.ie>, mat8033@iol.ie (Stuart Mc Bride) writes:
  14. >tate@netwest.com (Tate Griffin) wrote:
  15. >
  16. >>How do I get the current time and date from a PC using C++?
  17. >
  18.  
  19. Wow that was complicated, why not just use this (which will work on most
  20. systems, not just the PC):
  21.  
  22. #include<iostream.h>
  23. #include<time.h>
  24.  
  25. int main() {
  26.     cout << ctime( time( 0 ) ) << endl;
  27.     return 0; }
  28.  
  29.  
  30. Phil Staite, team OS/2
  31. internet: pstaite@vnet.ibm.com  internal: pstaite@rchland
  32.  
  33.